home *** CD-ROM | disk | FTP | other *** search
- /*==================================================================
- File: MacZStringWindow.h
-
- Contains: Primary window class for the Mac ZString tool
- (based on the PowerPlant framework)
-
- Written by: Eric Traut
-
- Copyright: 2000-2001 Connectix Corporation
-
- This source has been placed into the public domain by
- Connectix Corporation. You have the right to modify,
- distribute or use this code without any legal limitations
- or finanicial/licensing requirements. Connectix is not
- liable for any problems that result from the use of this
- code.
-
- If you have comments, feedback, questions, or would like
- to submit bug fixes or updates to this code, please email
- opensource@connectix.com.
- ==================================================================*/
-
- #ifndef _H_MacZStringWindow
- #define _H_MacZStringWindow
- #pragma once
-
- #include <LWindow.h>
- #include <LListener.h>
-
- #include "MacZStringFileSpec.h"
- #include "ZStringParser.h"
-
- const PaneIDT pane_AllowSemicolonCheckbox = FOUR_CHAR_CODE('SmCl');
- const PaneIDT pane_SortOutputCheckbox = FOUR_CHAR_CODE('Srt ');
- const PaneIDT pane_OutputDuplErrorCheckbox = FOUR_CHAR_CODE('Dupl');
- const PaneIDT pane_PrintWarningCheckbox = FOUR_CHAR_CODE('Warn');
- const PaneIDT pane_ConvertHighASCIICheckbox = FOUR_CHAR_CODE('Cvrt');
- const PaneIDT pane_LanguagePopup = FOUR_CHAR_CODE('LnPp');
- const PaneIDT pane_LanguageResourceTextBox = FOUR_CHAR_CODE('LnRs');
- const PaneIDT pane_NumericOutputRadioButton = FOUR_CHAR_CODE('OtNm');
- const PaneIDT pane_AlphaOutputRadioButton = FOUR_CHAR_CODE('OtAl');
-
- const PaneIDT pane_SourceGroupBox = FOUR_CHAR_CODE('SrGr');
- const PaneIDT pane_SourceFileIcon = FOUR_CHAR_CODE('SrIc');
- const PaneIDT pane_SourceFileNameStaticText = FOUR_CHAR_CODE('SrFl');
- const PaneIDT pane_SourceFileChooseButton = FOUR_CHAR_CODE('SrCh');
- const PaneIDT pane_CompareGroupBox = FOUR_CHAR_CODE('CmGr');
- const PaneIDT pane_CompareFileIcon = FOUR_CHAR_CODE('CmIc');
- const PaneIDT pane_CompareFileNameStaticText = FOUR_CHAR_CODE('CmFl');
- const PaneIDT pane_CompareFileChooseButton = FOUR_CHAR_CODE('CmCh');
- const PaneIDT pane_DestGroupBox = FOUR_CHAR_CODE('DsGr');
- const PaneIDT pane_DestFileIcon = FOUR_CHAR_CODE('DsIc');
- const PaneIDT pane_DestFileNameStaticText = FOUR_CHAR_CODE('DsFl');
- const PaneIDT pane_DestFileChooseButton = FOUR_CHAR_CODE('DsCh');
-
- const PaneIDT pane_ExtractButton = FOUR_CHAR_CODE('Extr');
- const PaneIDT pane_CompareButton = FOUR_CHAR_CODE('Comp');
- const PaneIDT pane_OverrideButton = FOUR_CHAR_CODE('Ovrd');
- const PaneIDT pane_QuitButton = FOUR_CHAR_CODE('Quit');
-
- const ResIDT ALRT_Error = 256;
-
-
- class MacZStringWindow : public LWindow, public LListener
- {
- public:
- enum { class_ID = FOUR_CHAR_CODE('ZStW') };
-
- MacZStringWindow(
- LStream * inStream);
-
- virtual
- ~MacZStringWindow();
-
- virtual void
- FinishCreateSelf();
-
- protected:
- void
- DoExtract();
-
- void
- DoCompare();
-
- void
- DoCreateOverride();
-
- void
- SelectFile(
- PaneIDT inTextID,
- PaneIDT inIconID,
- MacZStringFileSpec & outFileSpec,
- Boolean inExistingFile);
-
- void
- SetFile(
- PaneIDT inTextID,
- PaneIDT inIconID,
- const FSSpec & inFileSpec,
- MacZStringFileSpec & outFileSpec);
-
- void
- GetUserOptions(
- ZToolOptions & outOptions);
-
- private:
- virtual void
- ListenToMessage(
- MessageT inMessage,
- void * ioParam);
-
- void
- RegisterWidgets();
-
- void
- UpdateButtonStatus();
-
- void
- UpdateFileIcons();
-
- Boolean
- ReadBinaryImage(
- const FSSpec & inFileSpec,
- char * & outMemoryImage,
- UInt32 & outLength);
-
- void
- DisplayError(
- StringPtr inErrorString);
-
- void
- DisplaySuccess(
- StringPtr inSuccessString);
-
- OSErr
- SetTypeAndCreator(
- const FSSpec & inFileSpec,
- OSType inType,
- OSType inCreator);
-
- MacZStringFileSpec mSourceFileSpec;
- MacZStringFileSpec mCompareFileSpec;
- MacZStringFileSpec mDestFileSpec;
- };
-
- #endif // _H_MacZStringWindow
-
-
-
-